﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;

namespace testCA
{
    class Program
    {
        static void Main(string[] args)
        {
            string strJobName = string.Empty;
            string strJobUrl = string.Empty;

            SPAdministrationWebApplication centralWebApp = SPAdministrationWebApplication.Local;
            foreach (SPJobDefinition jobDefinition in centralWebApp.JobDefinitions)
            {
                strJobName = jobDefinition.Name;
                strJobUrl = string.Format("{0}_admin/JobEdit.aspx?JobId={1}", centralWebApp.Sites[0].ServerRelativeUrl, jobDefinition.Id);
                Console.WriteLine(string.Format("JobName={0}, JobUrl={1}", strJobName, strJobUrl));
            }

            Console.WriteLine("Completed. Press enter key to exit.");
            Console.ReadLine();
        }
    }
}
